<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
    $(function(){
        $("#btnSubmit").on('click',function(){
            var cardNo = readOneCard();
            if (!cardNo) {
                toastr.error("读卡失败");
                return false;
            } else {
                $("#cardNo").val(cardNo);
                $("#searchForm").submit();
                return false;
             }
         })
    })
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/med/medicalCardMaster/syAcct')">卡消费查询列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="medicalCardConsumeDetail"   method="post" class="form-inline"
                                           onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/med/medicalCardMaster/syAcct');">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                     消费时间:<input name="startTime"  value="${medicalCardConsumeDetail.startTime}" class="form-control Wdate" type="text"
                                           onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           readonly="readonly"/>
                                    <label>至</label>
                                    <input name="endTime"  value="${medicalCardConsumeDetail.endTime}" class="form-control Wdate" type="text"
                                           readonly="readonly"
                                           onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                    <form:hidden path="cardNo"/>
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="读卡查询"/>
                                  </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                        <th>消费金额</th>
                                        <th>项目名称</th>
                                        <th>单价</th>
                                        <th>数量</th>
                                        <th>类别</th>
                                        <th>消费时间</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="med">
                                <tr>
                                        <td> ${med.consumeMoney}</td>
                                        <td> ${med.itemName}</td>
                                        <td> ${med.itemPrice}</td>
                                        <td> ${med.amount}</td>
                                        <td> ${fns:getDictLabel(med.itemClass, 'BILL_ITEM_CLASS_DICT', '')}</td>
                                        <td><fmt:formatDate value="${med.createDate}"
                                                                pattern="yyyy-MM-dd HH:mm"/></td>                                        <%--<td> ${medicalCardRechangeRec.updateBy.id}</td>--%>
                                 </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>